package com.bestcem.xm.cjm.convert.grpc;

import com.bestcem.xm.cjm.grpc.client.dto.UserDto;
import org.mapstruct.*;


@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,
        collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS,
        uses = {BaseConvertMapper.class})
public interface CjmGrpcConvertMapper {
    @Mapping(target = "status", expression = "java(user.getStatus().getNumber())")
    @Mapping(target = "edition", expression = "java(user.getEdition().getNumber())")
    @Mapping(target = "userIndex", expression = "java(user.getIndex().getNumber())")
    @Mapping(target = "mobile", expression = "java(user.getPhone())")
    UserDto toUserDto(com.bestcem.bp.xm.user.grpc.v1.services.User user);
}
